$(function (){
    //表单验证
    $("#loginForm").validate({
        rules: {
            userId: {
                required: true,
            },
            userPassword: {
                required: true,
                minlength: 3,
                maxlength: 20
            }
        },
        messages: {
            userId: {
                required: "请输入用户名",
            },
            userPassword: {
                required:  "请输入密码",
                minlength:  "密码长度不能小于2位",
                maxlength:  "密码长度不能大于20位"
            }

        }
    })

})